<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<script type="text/javascript">
$('#tt').tabs({
    border:false,
    onSelect:function(title){
		alert(title+' is selected');
    }
});

function tables(tkzh){
 	$('#tkzh_jieguo').datagrid({    
 		//数据源地址
 		url:'tikuzonghechaxun',
 		queryParams:{
 			tmsub:tkzh
 		},
	    columns:[[
	    	{field:'TMZID',fixed:false,width:180,title:'题目编号',hidden:true,align:'center'},
	    	{field:'QSBBANK',fixed:false,width:180,title:'题库名',align:'center'},
	    	{field:'tm',fixed:false,width:180,title:'题目',align:'center'},
	        {field:'TMBDA',fixed:false,width:180,title:'答案',align:'center'},
	        {field:'TMNYD',fixed:false,width:180,title:'难易度',align:'center'},
	        {field:'TMZSD',fixed:false,width:180,title:'知识点',align:'center'},
	        {field:'TMFS',fixed:false,width:180,title:'分值',align:'center'}
	    
	    ]],
	    pagination:true,
	    pageNumber:1,
	    pageSize:5,
	    pageList:[5,10,15]       
	});
 	
}
/* //在每个操作列里面添加编辑，查看，明细，删除
function operate_formatter(value, row, index) {
 return "<button  class='tkzh_caozuoshanchu' onclick='deleteSJ("+row.TMZID+")'>删除</button>";
} 

//删除方法
function deleteSJ(TMZID){
	alert(TMZID);
	deleteBG("deleteDX","tkzh_jieguo",{"tmzid":TMZID});
} */
function tikuzonghesousuo(value,name){
    tables(value);
}
function tabless(QSBS){
	  $('#tkzh_jieguo').datagrid({    
	 		//数据源地址
	 		url:'zhtikuxiala',
	 		queryParams:{
	 			QSBS:QSBS
	 		},
		    columns:[[
		    	{field:'TMZID',fixed:false,width:180,title:'题目编号',hidden:true,align:'center'},
		    	{field:'QSBBANK',fixed:false,width:180,title:'题库名',align:'center'},
		    	{field:'tm',fixed:false,width:180,title:'题目',align:'center'},
		        {field:'TMBDA',fixed:false,width:180,title:'答案',align:'center'},
		        {field:'TMNYD',fixed:false,width:180,title:'难易度',align:'center'},
		        {field:'TMZSD',fixed:false,width:180,title:'知识点',align:'center'},
		        {field:'TMFS',fixed:false,width:180,title:'分值',align:'center'}
		       
		    ]],
		    pagination:true,
		    pageNumber:1,
		    pageSize:5,
		    pageList:[5,10,15]      
		});
}
	//显示
	 $('#Tiku2').combobox({
		 url:'tiku',
		 valueField:'QSBID',
		 textField:'QSBBANK',
		 onChange:function(){
			  var Tiku2 = $("#Tiku2").combobox("getText");
			  tabless(Tiku2);
		   }
	 });
	
	 $('#Zhishizu2').combobox({
		 url:'zhishidian',
		 valueField:'TMZID',
		 textField:'tmzsd',
		 onChange:function(){
			 var Zhishizu2 = $("#Zhishizu2").combobox("getText");
			 tabless(Zhishizu2);
		   }
	 });
	 
	 $('#Nanyidu2').combobox({
		 url:'nanyidu',
		 valueField:'TMZID',
		 textField:'tmnyd',
		 onChange:function(){
			  var Nanyidu2 = $("#Nanyidu2").combobox("getText");
			  tabless(Nanyidu2);
		   }
	 });
	 tables(null);
	 
		$(".pxkjpf_xianshi").click(function(){
			tables();
		})
	 	
 $(function(){
 		$("#tkzh_jieguo").datagrid({
 	        //双击事件
 	        onDblClickRow: function (index,row) {
 	        	$("#tk_zonghe").window("open");       
 	        	$("#timuid").val(row["TMZID"]);
 	        	$("#zh_daan").val(row["DA1"]);
 	        	$("#tkzh_timu").val(row["tm"]);
 	        	
 	              
 	        }
 	    });
 		
 		$(".tkzh_xiugai").click(function(){   
 			  var tmid=$("#timuid").val();
 	          var daan=$("#zh_daan").val();
 	          var timu=$("#tkzh_timu").val();
 		   $.ajax({
 				url:"zhtxiugai",
 				type:"post",
 				data:{
 					tmid:tmid,
 					daan:daan,
 					timu:timu,
 				},
 				success:function(data){
 				$("#tk_zonghe").window("close");
 				$( '#tkzh_jieguo').datagrid('reload');
 			}
 		  })
 		})
 		
 		
 		$(".tkzh_xinzeng").click(function(){
 			var text='新增综合试题';
 			var url="tyl/tk-zong-he-xin-zeng";
 			add(text,url)
 		
 		
 	});
 	
})
	

</script>
			 <div id="tk_zonghe" class="easyui-window" title="综合修改" style="width:690px;height:320px"
		    		data-options="closed:true,minimizable:false,maximizable:false,collapsible:false,modal:true">
		    		              <div class="zonghexiangqing_one">
		    		                   <div class="tkzh_timus">题目： <input type="text" id="tkzh_timu"></div>
		    		             </div>
		    		             <div class="zonghexiangqing_two">
		    		                   <div class="tkzh_daan"><span style="color:black;font-family:'微软雅黑';font-size:16px">答案：</span> <textarea cols="60" rows="10" class="tkzh_da" type="text" id="zh_daan"></textarea></div>
		    		             </div>
		    		      
		    		             <div class="zonghexiangqing_three">
		    		                  <button class="tkzh_xiugai">修改</button>
		    		             </div>
		    	
		    		</div>
			    	   
				<div class="tikuzonghexiangqing_zong">
				
				    <div class="tikuzonghexiangqing_shang">
				              <div class="tkzh_xianshi">
				                  <button class="tkzh_xinzeng">题目新增</button>
				                  <div class="zh_nanyidu">难易度：
				                  <input type="hidden" id="timuid">
				                  	    <input id="Nanyidu2" class="easyui-combobox nanyidushuru">
		    		                </div>
				                    <div class="zh_tiku">题库：
                                        <input id="Tiku2" class="easyui-combobox tikeshuru">
		    		                </div>
		    		                <div class="zh_zhishizu">知识组：
                                       <input id="Zhishizu2" class="easyui-combobox zhishizushuru">
		    		                </div>
				              </div>
				           
				              <div class="tkzh_shanchu">
				                  <input id="ss" class="easyui-searchbox" style="width:300px" data-options="searcher:tikuzonghesousuo,prompt:'查询'"></input>			
				                  
				              </div>
				    </div>
				    <div class="tikuzonghexiangqing_xia">
				             <table id="tkzh_jieguo" class="easyui-datagrid" style="width:100%;height:350px;margin-top:20px;" data-options="fitColumns:true">
                                  
                            </table>
				    </div>
				</div>
</body>
</html>